import React from 'react'

import MySnow from '@/components/MySnow'

export default class extends React.Component {
  state = {
    show: true,
  }
  onEnd = () => {
    this.setState({
      show: false,
    });
  }
  render() {
    const children = Array(5).fill(1).map((c, i) => (
      <div key={i} className="addMoneyAnim" style={{ animationDelay: `${-Math.random() * 0.6}s` }} />
    ));
    return (
      <div>
          问君能有几多愁，恰似一江春水向东流
          {this.state.show && (
            <MySnow onEnd={this.onEnd}>
              {children}
            </MySnow>
          )}
      </div>
    );
  }
}